package com.woniu.mapper;

import com.github.yulichang.base.MPJBaseMapper;
import com.woniu.entity.CtfRange;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import org.apache.ibatis.annotations.Mapper;

/**
* @author nanqiao
* @description 针对表【ctf_range(靶场)】的数据库操作Mapper
* @createDate 2025-06-10 14:29:54
* @Entity com.woniu.entity.CtfRange
*/
@Mapper
public interface CtfRangeMapper extends MPJBaseMapper<CtfRange>{
    List<CtfRange> selectPageList(@Param("range")CtfRange ctfRange);
    //    根据rangId查询difficultyId
    Integer selectDifficultyIdByRangeId(String rangeId);

    /**
     * 添加镜像到数据库
     * @param ctfRange
     */
    void insertCtf(CtfRange ctfRange);

    boolean updateByRangeId(@Param("range") CtfRange range);
    @Delete("delete from ctf_range where range_id = #{rangeId}")
    void deleteByRangeId(String rangeId);
    /**
     * 自定义根据 ID 查询靶场信息
     */
    CtfRange selectById(String rangeId);

    CtfRange selectByRangeName(String rangeName);

    String selectFlagPath(String rangeId);

    List<String> getAllContainers(String rangeId);

    void deleteByName(String rangeName);

    int selectTimeout(Integer difficultyId);
}




